@extends('admin._layouts.default')

@section('main')

      <div class="row-fluid ">
        <div class="span12 box gradient ">
      <div class="title">
            <div class="row-fluid">
                <h3><a href="{{ URL::route("admin.orders.suit") }}" class="btn btn-mini pull-right" style="margin:5px 5pwx 0 0"><i class="fa fa-hand-o-left"></i> 返回</a>
                  <i class="fa fa-archive"></i> 套装管理
                </h3>
            </div>
        </div><!-- End .title -->
        <div class="content">
            {{ Form::open(array('route' => 'admin.suits.store', 'files' => true,'id'=>'form_new')) }}
            <!-- 说明开始 -->
              <h3>套装概况</h3>
              <div class="form-row control-group row-fluid">
                <div class="controls span5">
                  <div class="input-prepend row-fluid">
                    <span class="add-on prepend "><i class="fa fa-archive"></i></span>
                    <input class="row-fluid" name="name" id="cloth2" required  size="50" type="text" placeholder="请描述这套套装的风格和概括">
                  </div>
                </div>
                <div class="controls span3">
                  <div class="input-prepend input-append row-fluid">
                    <span class="add-on prepend "><i class="fa fa-cny"></i></span>
                    <input class="row-fluid" name="total" id="price2" required  size="6" type="text"  placeholder="套餐价">
                    <span class="add-on ">.00</span>
                  </div>
                </div>
                <div class="controls span2">
                  <div class="input-append row-fluid">
                    <input type="file" name="cover" class="spa1n6" id="mainpic"><p class="help-block">上传套装效果图</p>
                  </div>
                </div>
              </div>
            <!-- 说明结束 -->
            <hr class="border_das">
            <h3>单品信息</h3>
            <!-- 第一条方案开始 -->
              <div class="form-row control-group row-fluid">
                <div class="controls span5">
                  <div class="input-prepend row-fluid">
                    <span class="add-on prepend "><i class="fa fa-tag"></i></span>
                    <input class="row-fluid" id="cloth2" name="dec[]" required  size="50" type="text" placeholder="请描述一款服饰单品，如全棉白色长袖衬衫">
                  </div>
                </div>
                <div class="controls span3">
                  <div class="input-prepend input-append row-fluid">
                    <span class="add-on prepend "><i class="fa fa-cny"></i></span>
                    <input class="row-fluid" id="price2" required name="price[]"  size="6" type="text" placeholder="单品会员价">
                    <span class="add-on ">.00</span>
                  </div>
                </div>
                <div class="controls span2">
                  <div class="input-append row-fluid">
                    <input type="file" name="pic[]" class="spa1n6" id="skupic1"><p class="help-block">上传单品照片</p>
                  </div>
                </div>
                <div class="controls span2">
                  <a href="javascript:void (0);" onclick="insert()" class="btn btn-primary   pull-right" rel="tooltip" data-placement="left" data-original-title="新增一条"><i class="fa  fa-plus"></i></a><!-- 第一条不能删 -->
                </div>
              </div>
            <!-- 第一条方案结束 -->
            <!-- 新增一条方案开始 -->
            <div id="to_copy" style="display: none;">
              <div class="form-row control-group row-fluid">
                <div class="controls span5">
                  <div class="input-prepend row-fluid">
                    <span class="add-on prepend "><i class="fa fa-tag"></i></span>
                    <input class="row-fluid" id="cloth2" required name="dec[]"  size="50" type="text" placeholder="请描述一款服饰单品，如全棉白色长袖衬衫">
                  </div>
                </div>
                <div class="controls span3">
                  <div class="input-prepend input-append row-fluid">
                    <span class="add-on prepend "><i class="fa fa-cny"></i></span>
                    <input class="row-fluid" id="price2" name="price[]" required  size="6" type="text"  placeholder="单品会员价">
                    <span class="add-on ">.00</span>
                  </div>
                </div>
                <div class="controls span2">
                  <div class="input-append row-fluid">
                    <input type="file" name="pic[]" class="spa1n6" id="skupic2">
                  </div>
                </div>
                <div class="controls span2">
                  <a href="javascript:void (0);" onclick="deletes(this)" class="btn btn-inverse pull-right" rel="tooltip" data-placement="left" data-original-title="删除本条"><i class="fa  fa-trash"></i></a>
                </div>
              </div>
            </div>
            <!-- 新增一条方案结束 -->
              <div class="form-actions row-fluid">
                <div class="span10 offset3">
                  <button onclick="sub();" class="btn btn-large btn-info"><i class="fa fa-paper-plane"></i> 立即发布</button>
                </div>
              </div>
            {{ Form::close() }}




            </div>
        </div>
        <!-- End box -->
      </div>


@stop

@section('script')
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.peity.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/chosen/chosen/chosen.jquery.min.js') }}"></script>

<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/flot/jquery.flot.js') }}"></script>



<script src="{{ URL::asset('web/js/scripts.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/jnavigate.jquery.min.js') }}"></script>

<script>

function insert(){
    var copy = $('#to_copy');
    var html = copy.html();
    copy.before(html);

}
function deletes(obj){
        $(obj).parent().parent().remove();

}
function sub(){
    $('#form_new').submit();
}
</script>
@stop
